//
// Created by 11510 on 2024/6/20.
//
#include <iostream>
#include <string>
#include <set>
using namespace std;

template<class T>
T add(T t1, T t2) {
    return t1 + t2;
}

template<>
set<int> add<set<int>>(set<int> t1, set<int> t2) {
    t1.merge(t2);
    return t1;
}



// 打印出容器
template <class Os, class K>
Os& operator<<(Os& os, const std::set<K>& v) {
    os << '[' << v.size() << "] {";
    bool o{};
    for (const auto& e : v)
        os << (o ? ", " : (o = 1, " ")) << e;
    return os << " }";
}

int main() {
    cout << add(1.2, 2.4) << endl;
    set<int> set1 = {1 ,2 ,3, 4};
    set<int> set2 = {4, 5, 3};

    set<int> tmp = add<set<int>>(set1, set2);
    cout << tmp << endl;
    return 0;
}
